/**
 * 初始化类库
 */
(function (win, doc) {
    //设置路径
    var js = document.scripts;
    var plug_path = js[js.length-1].src.substring(0,js[js.length-1].src.lastIndexOf("/")+1);
    /**
     * 公共类
     */
    Do.setConfig('coreLib',[plug_path + 'jquery.js']);
    Do.add('base',{path :plug_path + 'function.js'});

    /**
     * 弹窗组件
     */
    Do.add('layer_css',{path :plug_path + 'Plug-in/layer/skin/layer.css',type : 'css'});
    Do.add('layer',{path :plug_path + 'Plug-in/layer/layer.js',type : 'js',requires : ['layer_css']});

    /**
     * 表单提交+验证
     */
    Do.add('form_css',{path : plug_path + 'Plug-in/form/Validform.css',type : 'css'});
    Do.add('form_js',{path : plug_path + 'Plug-in/form/Validform.js',type : 'js'});
    Do.add('form',{path : plug_path + 'Plug-in/form/Validform_Datatype.js',type : 'js',requires : ['form_js','form_css']});

    /**
     * JS页面布局不兼容低版本浏览器
     */
    Do.add('layout_css',{path : plug_path + 'Plug-in/layout/style.css',type : 'css'});
    Do.add('layout',{path : plug_path + 'Plug-in/layout/jquery.layout.js',type : 'js',requires : ['layout_css']});

    /**
     * 目录树
     */
    Do.add('zTree_css',{path : plug_path + 'Plug-in/zTree/zTreeStyle.css',type : 'css'});
    Do.add('zTree',{path : plug_path + 'Plug-in/zTree/jquery.ztree.js',type : 'js',requires : ['zTree_css']
    });

    /**
     * 页面滑动
     */
    Do.add('slide',{path : plug_path + 'Plug-in/slide/SuperSlide.js',type : 'js'});

    /**
     * 百度上传
     */
    Do.add('upload_css',{path : plug_path + 'Plug-in/uploader/webuploader.css',type : 'css'});
    Do.add('upload',{path : plug_path + 'Plug-in/uploader/webuploader.min.js',type : 'js',requires : ['upload_css']});

    /**
    * 万能浮动层菜单
    */
    Do.add('tip_css',{path : plug_path + 'Plug-in/tip/style.css',type : 'css'});
    Do.add('tip',{path : plug_path + 'Plug-in/tip/powerFloat.js',type : 'js',requires : ['tip_css']});

    /**
     * 进度条
     */
    Do.add('nprogress_css',{path : plug_path + 'Plug-in/nprogress/nprogress.css',type : 'css'});
    Do.add('nprogress',{path : plug_path + 'Plug-in/nprogress/nprogress.js',type : 'js',requires : ['nprogress_css']});
 
    /**
     * 编辑器
     */
    Do.add('editor_js',{path : plug_path + 'Plug-in/editor/kindeditor-min.js'});
    Do.add('editor',{path : plug_path + 'Plug-in/editor/lang/zh_CN.js',type : 'js',requires : ['editor_js']});
 
    /**
     * 日期选择
     */
    Do.add('datecss',{path : plug_path + 'Plug-in/date/jquery.datetimepicker.css',type : 'css'});
    Do.add('date',{path : plug_path + 'Plug-in/date/jquery.datetimepicker.js',type : 'js',requires:['datecss']});

    /**
     * 图片动画效果
     */
    Do.add('swipercss',{path : plug_path + 'Plug-in/swiper/swiper.css',type:'css'});
    Do.add('swiper',{path : plug_path + 'Plug-in/swiper/swiper.js',type : 'js',requires : ['swipercss']});

    /**
     * 取色器
     */
    Do.add('colorcss',{path : plug_path + 'Plug-in/color/style.css',type : 'css'});
    Do.add('color',{path : plug_path + 'Plug-in/color/ColorPacker.js',type : 'js',requires : ['colorcss']});

    /**
     * 切换
     */
    Do.add('tab',{path :plug_path + 'Plug-in/tab/jquery.idTabs.min.js',type : 'js'});

    /**
     * JS模板引擎
     */
    Do.add('tpl',{path :plug_path + 'Plug-in/laytpl/laytpl.js',type : 'js',type: 'js'});

    /**
     * 表单
     */
    Do.add('jform', {path: plug_path + 'Plug-in/form/jquery.form.js',type: 'js'});

    /**
     * 通知
     */
    Do.add('notifyCss', {path: plug_path + 'Plug-in/notify/amaran.min.css',type: 'css'});
    Do.add('notify', {path: plug_path + 'Plug-in/notify/jquery.amaran.min.js',type: 'js',requires: ['notifyCss']});

    /**
     * 复制
     */
    Do.add('copy', {path : plug_path + 'Plug-in/copy/ZeroClipboard.min.js',type: 'js'});

    /**
     * 二维码
     */
    Do.add('qrcode', {path: plug_path + 'Plug-in/qrcode/qrcode.js',type: 'js'});

    /**
     * 分页
     */
    Do.add('laypageCss', {path: plug_path + 'Plug-in/laypage/skin/laypage.css',type: 'css'});
    Do.add('laypage', {path: plug_path + 'Plug-in/laypage/laypage.js',type: 'js',requires: ['laypageCss']});
})(window, document);